package com.coderjacky.search.service.Impl;

import com.coderjacky.common.core.web.domain.AjaxResult;
import com.coderjacky.search.domain.SpuInfo;
import com.coderjacky.search.mapper.SpuInfoMapper;
import com.coderjacky.search.service.SpuInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName SpuInfoServiceImpl
 * @Description 描述
 * @Author GYW
 * @Date 2024-12-18 22:13
 */
@Service
public class SpuInfoServiceImpl implements SpuInfoService {

    @Autowired
    private SpuInfoMapper spuInfoMapper;


    @Override
    public AjaxResult updateStatus(SpuInfo spuInfo) {

        Integer i = spuInfoMapper.updateStatus(spuInfo);
        if (i > 0){
            return AjaxResult.success();
        }

        return AjaxResult.error();
    }

    @Override
    public AjaxResult selectList() {

        List<SpuInfo> spuInfos = spuInfoMapper.selectList();

        return AjaxResult.success(spuInfos);
    }
}
